/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cn.ekuma.epos.datalogic;

import com.openbravo.data.basic.BasicException;
import com.openbravo.data.loader.I_Session;
import com.openbravo.data.loader.SentenceList;
import com.openbravo.bean.PlaceState;
import com.openbravo.bean.erp.Order;
import com.openbravo.bean.sales.KitchenWorkLine;
import com.openbravo.bean.sales.Ticket;
import com.openbravo.bean.sales.SharedTicketInfo;

import java.util.Date;
import java.util.List;

import net.xeoh.plugins.base.PluginManager;

/**
 *
 * @author Administrator
 */
public interface I_DataLogicReceipts {

    void deleteSharedTicket(final String id) throws BasicException;

    Ticket getSharedTicket(String Id) throws BasicException;

    List<SharedTicketInfo> getSharedTicketList(String locationId) throws BasicException;

    void insertSharedTicket(final String id, final Ticket ticket) throws BasicException;
    
    void insertSharedTicketNoLock(final String id, final Ticket ticket) throws BasicException;

    void updateSharedTicket(final String id, final Ticket ticket, String userId) throws BasicException;
    
    public void updateSharedTicketAndUnLocked(String id, final Ticket ticket)throws BasicException;

    public void insertSharedOrder(String m_sCurrentOrder, Order activeOrder) throws BasicException;

    public void updateSharedOrder(String m_sCurrentOrder, Order activeOrder, String userID) throws BasicException;

    public void setSharedTicketLocked(String id,boolean locked, String userID) throws BasicException;
    
    public Order getSharedOrder(String id)throws BasicException;

    public void deleteSharedOrder(String id)throws BasicException;

    public List<String> getSharedOrderList()throws BasicException;

    public void setSharedOrderLocked(String id,boolean locked, String userID) throws BasicException;

    public void updateSharedOrderAndUnLocked(String m_sCurrentOrder, Order activeOrder)throws BasicException;

    public SentenceList getSharedOrderListQBF() ;
    
    public void sendToKitchen(String id, Ticket t)throws BasicException ;
    
    public List<KitchenWorkLine> listByTicket(String ticketId)throws BasicException ;
    
    public void urgentToKitch(String ticketId)throws BasicException ;
    
    public void updateLineState(final String id,final String host,final int order,final int state)throws BasicException;
    
    public void cooking(String id,String host,int order)throws BasicException;
    
    public void backForWait(String id)throws BasicException;
    
    public void updateTicketState(final String ticketId,final int state)throws BasicException;
    
    public void ticketDelete(String ticketId)throws BasicException;
    
    public List<KitchenWorkLine> listKitchenWorkLineByLineState(int lineState)throws BasicException;
    
    public List<KitchenWorkLine> listKitchenWorkLineByHostCooking(String host)throws BasicException;
    
    List<KitchenWorkLine> listKitchenWorkLineByTicketID(String ticketId)throws BasicException ;

	SentenceList getSharedLinkOrderListQBF();

	void insertLinkSharedOrder(String m_sCurrentOrder, Order activeOrder) throws BasicException;

	void insertSharedOrderNoLock(String id, Order order)throws BasicException;
	
	List<PlaceState> loadPlacesStateBetween(Date begin,Date after)throws BasicException;
	
	void joinGroup(String id,String group)throws BasicException;
	
	void updatePlaceState(String id,String newState)throws BasicException;
	
	void setPlaceManager(String id,String manager)throws BasicException;
	
	boolean isSharedTicketLocked(String id) throws BasicException;
	
    void lockSharedTicket(String id,String userId) throws BasicException;
}
